<?php
class Advert_model extends BZ_Model
{
    protected $table = 'advert';

    public function findBySourceState($source_state)
    {
        $this->db->where('source_state', $source_state);
        $this->db->where('flag', 1);
        $this->db->order_by('sort', 'ASC');
        return $this->db->get($this->table);
    }
    
    public function delete($id)
    {
        if (empty($id)){
            return false;
        }
        $this->db->where('id',$id);
        return $this->db->delete($this->table);
    }
}